Optimal. Leaf size=171 \[ -\frac {i a^6}{32 d (a-i a \tan (c+d x))^4}-\frac {i a^5}{16 d (a-i a \tan (c+d x))^3}-\frac {3 i a^4}{32 d (a-i a \tan (c+d x))^2}+\frac {i a^4}{64 d (a+i a \tan (c+d x))^2}-\frac {5 i a^3}{32 d (a-i a \tan (c+d x))}+\frac {5 i a^3}{64 d (a+i a \tan (c+d x))}+\frac {15 a^2 x}{64} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.11, antiderivative size = 171, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {3487, 44, 206} \[ -\frac {i a^6}{32 d (a-i a \tan (c+d x))^4}-\frac {i a^5}{16 d (a-i a \tan (c+d x))^3}-\frac {3 i a^4}{32 d (a-i a \tan (c+d x))^2}+\frac {i a^4}{64 d (a+i a \tan (c+d x))^2}-\frac {5 i a^3}{32 d (a-i a \tan (c+d x))}+\frac {5 i a^3}{64 d (a+i a \tan (c+d x))}+\frac {15 a^2 x}{64} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 44
Rule 206
Rule 3487
Rubi steps
\begin {align*} \int \cos ^8(c+d x) (a+i a \tan (c+d x))^2 \, dx &=-\frac {\left (i a^9\right ) \operatorname {Subst}\left (\int \frac {1}{(a-x)^5 (a+x)^3} \, dx,x,i a \tan (c+d x)\right )}{d}\\ &=-\frac {\left (i a^9\right ) \operatorname {Subst}\left (\int \left (\frac {1}{8 a^3 (a-x)^5}+\frac {3}{16 a^4 (a-x)^4}+\frac {3}{16 a^5 (a-x)^3}+\frac {5}{32 a^6 (a-x)^2}+\frac {1}{32 a^5 (a+x)^3}+\frac {5}{64 a^6 (a+x)^2}+\frac {15}{64 a^6 \left (a^2-x^2\right )}\right ) \, dx,x,i a \tan (c+d x)\right )}{d}\\ &=-\frac {i a^6}{32 d (a-i a \tan (c+d x))^4}-\frac {i a^5}{16 d (a-i a \tan (c+d x))^3}-\frac {3 i a^4}{32 d (a-i a \tan (c+d x))^2}-\frac {5 i a^3}{32 d (a-i a \tan (c+d x))}+\frac {i a^4}{64 d (a+i a \tan (c+d x))^2}+\frac {5 i a^3}{64 d (a+i a \tan (c+d x))}-\frac {\left (15 i a^3\right ) \operatorname {Subst}\left (\int \frac {1}{a^2-x^2} \, dx,x,i a \tan (c+d x)\right )}{64 d}\\ &=\frac {15 a^2 x}{64}-\frac {i a^6}{32 d (a-i a \tan (c+d x))^4}-\frac {i a^5}{16 d (a-i a \tan (c+d x))^3}-\frac {3 i a^4}{32 d (a-i a \tan (c+d x))^2}-\frac {5 i a^3}{32 d (a-i a \tan (c+d x))}+\frac {i a^4}{64 d (a+i a \tan (c+d x))^2}+\frac {5 i a^3}{64 d (a+i a \tan (c+d x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.59, size = 138, normalized size = 0.81 \[ \frac {a^2 (-120 i d x \sin (2 (c+d x))+30 \sin (2 (c+d x))+32 \sin (4 (c+d x))+3 \sin (6 (c+d x))+30 (4 d x-i) \cos (2 (c+d x))+16 i \cos (4 (c+d x))+i \cos (6 (c+d x))-80 i) (\cos (2 (c+2 d x))+i \sin (2 (c+2 d x)))}{512 d (\cos (d x)+i \sin (d x))^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.56, size = 106, normalized size = 0.62 \[ \frac {{\left (120 \, a^{2} d x e^{\left (4 i \, d x + 4 i \, c\right )} - i \, a^{2} e^{\left (12 i \, d x + 12 i \, c\right )} - 8 i \, a^{2} e^{\left (10 i \, d x + 10 i \, c\right )} - 30 i \, a^{2} e^{\left (8 i \, d x + 8 i \, c\right )} - 80 i \, a^{2} e^{\left (6 i \, d x + 6 i \, c\right )} + 24 i \, a^{2} e^{\left (2 i \, d x + 2 i \, c\right )} + 2 i \, a^{2}\right )} e^{\left (-4 i \, d x - 4 i \, c\right )}}{512 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 2.03, size = 342, normalized size = 2.00 \[ \frac {120 \, a^{2} d x e^{\left (8 i \, d x + 4 i \, c\right )} + 240 \, a^{2} d x e^{\left (6 i \, d x + 2 i \, c\right )} + 120 \, a^{2} d x e^{\left (4 i \, d x\right )} + 8 i \, a^{2} e^{\left (8 i \, d x + 4 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 16 i \, a^{2} e^{\left (6 i \, d x + 2 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 8 i \, a^{2} e^{\left (4 i \, d x\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - 8 i \, a^{2} e^{\left (8 i \, d x + 4 i \, c\right )} \log \left (e^{\left (2 i \, d x\right )} + e^{\left (-2 i \, c\right )}\right ) - 16 i \, a^{2} e^{\left (6 i \, d x + 2 i \, c\right )} \log \left (e^{\left (2 i \, d x\right )} + e^{\left (-2 i \, c\right )}\right ) - 8 i \, a^{2} e^{\left (4 i \, d x\right )} \log \left (e^{\left (2 i \, d x\right )} + e^{\left (-2 i \, c\right )}\right ) - i \, a^{2} e^{\left (16 i \, d x + 12 i \, c\right )} - 10 i \, a^{2} e^{\left (14 i \, d x + 10 i \, c\right )} - 47 i \, a^{2} e^{\left (12 i \, d x + 8 i \, c\right )} - 148 i \, a^{2} e^{\left (10 i \, d x + 6 i \, c\right )} - 190 i \, a^{2} e^{\left (8 i \, d x + 4 i \, c\right )} - 56 i \, a^{2} e^{\left (6 i \, d x + 2 i \, c\right )} + 28 i \, a^{2} e^{\left (2 i \, d x - 2 i \, c\right )} + 50 i \, a^{2} e^{\left (4 i \, d x\right )} + 2 i \, a^{2} e^{\left (-4 i \, c\right )}}{512 \, {\left (d e^{\left (8 i \, d x + 4 i \, c\right )} + 2 \, d e^{\left (6 i \, d x + 2 i \, c\right )} + d e^{\left (4 i \, d x\right )}\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.54, size = 141, normalized size = 0.82 \[ \frac {-a^{2} \left (-\frac {\sin \left (d x +c \right ) \left (\cos ^{7}\left (d x +c \right )\right )}{8}+\frac {\left (\cos ^{5}\left (d x +c \right )+\frac {5 \left (\cos ^{3}\left (d x +c \right )\right )}{4}+\frac {15 \cos \left (d x +c \right )}{8}\right ) \sin \left (d x +c \right )}{48}+\frac {5 d x}{128}+\frac {5 c}{128}\right )-\frac {i a^{2} \left (\cos ^{8}\left (d x +c \right )\right )}{4}+a^{2} \left (\frac {\left (\cos ^{7}\left (d x +c \right )+\frac {7 \left (\cos ^{5}\left (d x +c \right )\right )}{6}+\frac {35 \left (\cos ^{3}\left (d x +c \right )\right )}{24}+\frac {35 \cos \left (d x +c \right )}{16}\right ) \sin \left (d x +c \right )}{8}+\frac {35 d x}{128}+\frac {35 c}{128}\right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.49, size = 115, normalized size = 0.67 \[ \frac {15 \, {\left (d x + c\right )} a^{2} + \frac {15 \, a^{2} \tan \left (d x + c\right )^{7} + 55 \, a^{2} \tan \left (d x + c\right )^{5} + 73 \, a^{2} \tan \left (d x + c\right )^{3} + 49 \, a^{2} \tan \left (d x + c\right ) - 16 i \, a^{2}}{\tan \left (d x + c\right )^{8} + 4 \, \tan \left (d x + c\right )^{6} + 6 \, \tan \left (d x + c\right )^{4} + 4 \, \tan \left (d x + c\right )^{2} + 1}}{64 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 4.03, size = 144, normalized size = 0.84 \[ \frac {15\,a^2\,x}{64}+\frac {\frac {15\,a^2\,{\mathrm {tan}\left (c+d\,x\right )}^5}{64}+\frac {a^2\,{\mathrm {tan}\left (c+d\,x\right )}^4\,15{}\mathrm {i}}{32}+\frac {5\,a^2\,{\mathrm {tan}\left (c+d\,x\right )}^3}{32}+\frac {a^2\,{\mathrm {tan}\left (c+d\,x\right )}^2\,25{}\mathrm {i}}{32}-\frac {17\,a^2\,\mathrm {tan}\left (c+d\,x\right )}{64}+\frac {a^2\,1{}\mathrm {i}}{4}}{d\,\left ({\mathrm {tan}\left (c+d\,x\right )}^6+{\mathrm {tan}\left (c+d\,x\right )}^5\,2{}\mathrm {i}+{\mathrm {tan}\left (c+d\,x\right )}^4+{\mathrm {tan}\left (c+d\,x\right )}^3\,4{}\mathrm {i}-{\mathrm {tan}\left (c+d\,x\right )}^2+\mathrm {tan}\left (c+d\,x\right )\,2{}\mathrm {i}-1\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.53, size = 272, normalized size = 1.59 \[ \frac {15 a^{2} x}{64} + \begin {cases} \frac {\left (- 8589934592 i a^{2} d^{5} e^{14 i c} e^{8 i d x} - 68719476736 i a^{2} d^{5} e^{12 i c} e^{6 i d x} - 257698037760 i a^{2} d^{5} e^{10 i c} e^{4 i d x} - 687194767360 i a^{2} d^{5} e^{8 i c} e^{2 i d x} + 206158430208 i a^{2} d^{5} e^{4 i c} e^{- 2 i d x} + 17179869184 i a^{2} d^{5} e^{2 i c} e^{- 4 i d x}\right ) e^{- 6 i c}}{4398046511104 d^{6}} & \text {for}\: 4398046511104 d^{6} e^{6 i c} \neq 0 \\x \left (- \frac {15 a^{2}}{64} + \frac {\left (a^{2} e^{12 i c} + 6 a^{2} e^{10 i c} + 15 a^{2} e^{8 i c} + 20 a^{2} e^{6 i c} + 15 a^{2} e^{4 i c} + 6 a^{2} e^{2 i c} + a^{2}\right ) e^{- 4 i c}}{64}\right ) & \text {otherwise} \end {cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________